x=int(input())
y=int(input())
z=int(input())
ans=0
eps=10**(-10)
for num in range(100,1000):
    k=num%10
    j=int(int(num/10+eps)%10)
    i=int(num/100+eps)
    for a in range(1,x):
        for b in range(1,y):
            for c in range(1,z):
                if (i**a)+(j**b)+(k**c)==num:
                    ans+=1
print(ans)